package com.asom.player.service;

public class Album implements Comparable<Album>
{
	String key;
	String name;
	String albumArt;
	String artist;
	
	int firstYear = -1;
	int lastYear = -1;
	int nrSongs = -1;
	
	public Album(
			String _key,
			String _name,
			String _albumArt,
			String _artist,
			String _firstYear,
			String _lastYear,
			String _nrSongs)
	{
		key = _key;
		name = _name;
		albumArt = _albumArt;
		artist = _artist;
		
		try
		{
			firstYear = Integer.parseInt(_firstYear);
			lastYear = Integer.parseInt(_lastYear);
			nrSongs = Integer.parseInt(_nrSongs);
		}
		catch(NumberFormatException _ex)
		{
		}
	}
	
	String getKey()
	{
		return key;
	}
	
	public String getName()
	{
		return name;
	}
	
	public String getAlbumArt()
	{
		return albumArt;
	}
	
	public String getArtist()
	{
		return artist;
	}
	
	public int getFirstYear()
	{
		return firstYear;
	}
	
	public int getLastYear()
	{
		return lastYear;
	}
	
	public int getNrSongs()
	{
		return nrSongs;
	}
	
	@Override
	public int compareTo(Album another)
	{
		return this.getName().compareTo(another.getName());
	}
}
